<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body id="test">
    <input id="add" type="button" value="增加" onclick="add();"/>
    <input id="del" type="button" value="删除" onclick="del();"/>
    <div id="target" style="width:240px;height:50px;border:1px solid black;"></div>
<script type="text/javascript">
    var body = document.getElementById("test");
    var target = document.getElementById("target");
    var add = function(){
        body.appendChild(target);
        document.getElementById("add").disabled = "disabled";
        document.getElementById("del").disabled = "";
    }
    var del = function(){
    body.removeChild(target);
    document.getElementById("del").disabled = "disabled";
    document.getElementById("add").disabled = "";
    }
</script>
</body>

</html>